﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace psafth.AMB
{
    public class GeneralSettings
    {
        /// <summary>
        /// The current time of the decoder (when the decoder sent it.....)
        /// </summary>
        public DateTime RTCTime
        {
            get;
            set;
        }

        /// <summary>
        /// Constructs the GeneralSettings object from the field of records
        /// </summary>
        /// <param name="fieldOfRecords"></param>
        public GeneralSettings(List<DataRowObject> fieldOfRecords)
        {
            foreach (DataRowObject record in fieldOfRecords)
            {
                switch (record.DataType)
                {
                    case (int)AMBGeneralSettingsFOR.REAL_TIME_CLOCK:
                        this.RTCTime = AMBCalculator.GetPassingTime(record.Data);
                        break;
                }
            }
        }
    }
}
